package com.atguigu.jsp.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet(urlPatterns = "/Servlet01TestRequestScope")
public class Servlet01TestRequestScope extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 1、把数据存入请求域
        request.setAttribute("attrNameRequest", "attrValueRequest");

        // 2、执行请求转发
        request.getRequestDispatcher("/pages/target.jsp").forward(request, response);
    }
}
